package userDefThreadPool;

public class MyTask implements Runnable {
    Thread currentThread;
    private String taskName;
public MyTask(String taskName){
	this.taskName = taskName;
}
    @Override
    public void run() {
        currentThread = Thread.currentThread();
System.out.println(taskName + " executed by thread "+ currentThread.getName());
    }

    public void interrupt() {
        if (currentThread != null) {
            currentThread.interrupt();

        }
    }

}
